﻿using RecruitStudents.Utility;
using RecruitStudents.Utility.Helper;
using RecruitStudents.Utility.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RecruitStudents.Client
{
    public partial class ScoreDisPlay : BaseForm
    {
        private static string strScoreDisPlayUrl = System.Configuration.ConfigurationManager.AppSettings["ScoreDisPlayUrl"];
        private string strSpecNo = SessionerHelper.SpecialityKindsNO;
        public ScoreDisPlay()
        {
            InitializeComponent();
            webBrowser1.IsWebBrowserContextMenuEnabled = false;
            SetWebBrowserUrl();
            //if (SessionerHelper.SpecialityKindsNO == "1303010_D")
            //{
            //    this.timer1.Interval = 1000 * 30;
            //}
            //else
            //{
            //    this.timer1.Interval = 1000 * 5;
            //}
            //this.timer1.Enabled = true;
        }

        private void SetWebBrowserUrl()
        {
            Uri url = null;
            if (SessionerHelper.SpecialityKindsNO == "1303010_D")//表演表---7
            {
                url = new Uri(strScoreDisPlayUrl + "/ScoreDisplay7.aspx?SystemYear=" + SessionerHelper.SystemYear + "&SpecialityKindsNO=" + SessionerHelper.SpecialityKindsNO + "&ExamRoomNo=" + SessionerHelper.ExamRoomID);
            }
            else if (SessionerHelper.SpecialityKindsNO == "1303090_B")//播音   文稿和才艺--5.2
            {
                url = new Uri(strScoreDisPlayUrl + "/ScoreDisplay5_2.aspx?SystemYear=" + SessionerHelper.SystemYear + "&SpecialityKindsNO=" + SessionerHelper.SpecialityKindsNO + "&ExamRoomNo=" + SessionerHelper.ExamRoomID);
            }
            else
            {
                url = new Uri(strScoreDisPlayUrl + "/ScoreDisplay5.aspx?SystemYear=" + SessionerHelper.SystemYear + "&SpecialityKindsNO=" + SessionerHelper.SpecialityKindsNO + "&ExamRoomNo=" + SessionerHelper.ExamRoomID);
            }
            webBrowser1.Url = url;
        }

        private void ScoreDisPlay_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.timer1.Enabled = false;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            //SetWebBrowserUrl();
        }
    }
}
